package com.example.zsfinacialmanage.utils;

import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;

public class UserExistQuery {
    // 查询数据库，检查是否存在相同用户名的用户
    public static boolean isUserExists(String username, SQLiteDatabase db) {
        Cursor cursor;
        String query = "SELECT * FROM tb_userinfo WHERE name=?";
        cursor = db.rawQuery(query, new String[]{username});
        return cursor != null && cursor.getCount() > 0;
    }
}
